package com.production.CoursePlatform.service;

import com.production.CoursePlatform.dto.CourseWithUnreadCountDTO;
import com.production.CoursePlatform.entity.StudentNotice;
import com.production.CoursePlatform.mapper.StudentNoticeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentNoticeService {
    @Autowired
    private StudentNoticeMapper studentNoticeMapper;

    public int getStudentNumberOfCtID(int cnID) {
        return studentNoticeMapper.getStudentNumberOfCtID(cnID);
    }

    public int updateStudying(int snID) {
        return studentNoticeMapper.updateStudying(snID);
    }

    public List<StudentNotice> findUnreadInCtID(int cnID) {
        return studentNoticeMapper.findUnreadInCtID(cnID);
    }

    public List<CourseWithUnreadCountDTO> findCoursesWithUnreadNoticesBySID(int sID) {
        return studentNoticeMapper.findCoursesWithUnreadNoticesBySID(sID);
    }

    public int findTotalUnreadMessagesBySID(int sID) {
        return studentNoticeMapper.findTotalUnreadMessagesBySID(sID);
    }
}
